import request from '@/utils/request'

export function fetchList(query) {
    return request({
        url: '/repair/api/workSchedule/query/page',
        method: 'get',
        params: query
    })
}

//保存设备信息
export function saveInfo(query) {
    if (query.id) {
        return request({
            url: '/repair/api/workSchedule/update',
            method: 'put',
            data: query
        })
    } else {
        return request({
            url: '/repair/api/workSchedule/save',
            method: 'post',
            data: query
        })
    }

}
//设备详细信息
export function fetchDetailInfo(query) {
    return request({
        url: '/device/api/device/query/' + query,
        method: 'get',
    })
}
//导出
export function exportFile(params) {
    return request({
        url: '/device/api/device/exportExcel',
        method: 'get',
    })
}
//下载批量导入模板

export function downloadTemplete(query) {
    return request({
        url: '/minio/minio/outSideChain',
        method: 'get',
        params: query
    })
}
//删除台账
export function deleteDeviceInfo(id) {
    return request({
        url: `/repair/api/workSchedule/delete/${id}`,
        method: 'delete',
        //data: query
    })
}
export function resetPwd(query) {
    return request({
        url: '/user/api/user/password/reset/' + query,
        method: 'PUT',
        //data: query
    })
}
//启用
export function startUserInfo(query) {
    return request({
        url: '/user/api/user/start/' + query,
        method: 'put',
        //data: query
    })
}
//停用
export function stopUserInfo(query) {
    return request({
        url: '/user/api/user/stop/' + query,
        method: 'put',
        //data: query
    })
}